package com.qf.pickname.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Arrays;
import java.util.Date;

/**
 * 用来接收请求参数的类
 */
public class StudentVO {

    private String name;

    private Boolean sex;

    private Integer age;

    private String[] hobby;


    @Override
    public String toString() {
        return "StudentVO{" +
                "name='" + name + '\'' +
                ", sex=" + sex +
                ", age=" + age +
                ", hobby=" + Arrays.toString(hobby) +
                ", birth=" + birth +
                '}';
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")  // 作用1：会影响返回的json中的日期的格式
    private Date birth;

    public StudentVO() {
    }

    public StudentVO(String name, Boolean sex, Integer age, Date birth) {
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.birth = birth;
    }

    public String[] getHobby() {
        return hobby;
    }

    public void setHobby(String[] hobby) {
        this.hobby = hobby;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getSex() {
        return sex;
    }

    public void setSex(Boolean sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getBirth() {
        return birth;
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }
}
